<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>友情链接</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <!-- load css -->
    <link rel="stylesheet" type="text/css" href="../../common/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../css/common.css" media="all">
    <style type="text/css">
        .bottom-btn-div {width:172px;margin:0 auto;}
        .layui-form .layui-form-label {text-align:center;}
        .layui-form .layui-form-label,
        .layui-form .layui-input-block input,
        .layui-form .layui-input-block textarea {color:#666666;}
    </style>
</head>
<body>
<div class="layui-fluid cms-wrapper">
    <fieldset class="layui-elem-field layui-field-title">
        <legend><a name="methodRender">添加友情链接</a></legend>
    </fieldset>

    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">网站名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="required" placeholder="请输入网站名称" value="百度" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">网站地址</label>
            <div class="layui-input-block">
                <input type="url" name="url" class="layui-input" lay-verify="required|url" placeholder="请输入网站地址" value="http://www.baidu.com" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">站长邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="email" class="layui-input" lay-verify="email" placeholder="请输入站长邮箱" value="141972@qq.com" />
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">站点描述</label>
            <div class="layui-input-block">
                <textarea name="content" placeholder="请输入站点描述" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item bottom-btn-div">
            <button class="layui-btn" lay-submit lay-filter="add">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </form>
</div>
<!-- 加载js文件 -->
<script type="text/javascript" src="../../common/layui/layui.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript">
    layui.use(['layer','form'],function(){
        var $     = layui.$,
            layer = layui.layer,
            form  = layui.form;

        form.on('submit(add)',function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            },function (e) {
                var index = parent.layer.getFrameIndex(window.name);
                if (index) {
                    parent.layer.close(index);
                } else {
                    layer.close(e);
                }
            });
            return false;
        });
    });
</script>
</body>
</html>